package com.ruirenyun.util.ocr;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author Deng Ye
 * @version 1.0
 * @description
 * @date 2021/4/12 20:40
 */
@Data
@ConditionalOnProperty(prefix = "baidu", name = {"appid", "appKey", "secretkey"})
@Component
public class OcrConfig {

    @Value("${baidu.appid}")
    private String appid;

    @Value("${baidu.appKey}")
    private String appKey;

    @Value("${baidu.secretkey}")
    private String secretkey;

    @PostConstruct
    public void init() {
        OcrUtil.setOcrConfig(this);
    }

}